export default class bigeMap3d{
	constructor() {
	    this.config
	}
	init(){
		
	}
	// 加载地图所需的js和css
	loadingFunc(config) {
		this.config = config
		let url = this.config.mapUrl
		const js = [
			`${url}/bigemap-gl.js/v1.1.0/bigemap-gl.js`,
			'./mapEdit/bm.draw.min.js'
		]
		const css = [
			`${url}/bigemap-gl.js/v1.1.0/Widgets/widgets.css`,
			'./mapEdit/Bigemap.draw.css'
		]
		return new Promise((reslove, reject) => {
			// 加载css
			let link = css.map(v => {
				let css = document.createElement("link");
				css.rel = "stylesheet";
				css.async = false;
				css.href = v;
				document.head.appendChild(css);
			});
			// 加载js
			let script = js.map(v => {
				let js = document.createElement("script");
				js.type = "text/javascript";
				js.async = false;
				js.src = v;
				document.head.appendChild(js);
				return js;
			});
			let end = script.pop();
			end.onload = reslove;
		})
	}
}